{% extends "main.html" %}
{% block content %}
    <h1>{{ catalog.name }}</h1>
    <p>以下案例由相关职能部门及企业提供，如有不实请与我们联系</p>
    <div class="accordion" id="accordion2">
    {% for obj in catalog.nexts %}
        <div class="accordion-group">
            <div class="accordion-heading">
                <a class="accordion-toggle btn" data-toggle="collapse" data-parent="#accordion2" href="#tag_{{ obj.id }}">
                    {{ obj.name }}
                </a>
            </div>
            <div id="tag_{{ obj.id }}" class="accordion-body collapse">
                <div class="accordion-inner">
                    {% if obj.doc_type %}
                        {{ obj|content }}
                    {% else %}
                        <ul id="myTab" class="nav nav-tabs">
                        {% for i,doc in obj.indexed_next() %}
                            <li {% if not i %}class="active"{% endif %}><a href="" data-toggle="tab">{{ doc.title }}</a></li>
                        {% endfor %}
                        </ul>
                        {{ obj.nexts| one | content|safe }}
                    {% endif %}
                </div>
            </div>
        </div>
    {% endfor %}
    </div>
{% endblock %}